package cn.com.winning.ecare.common;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.WindowManager;
import cn.com.winning.ecare.activity.R;

public class MyProgressDialog extends Dialog
{

	private Context context = null;
	private static MyProgressDialog myProgressDialog = null;
	private static RoundProgressBar myProgress = null;

	public MyProgressDialog(Context context)
	{
		super(context);
		this.context = context;
	}

	public MyProgressDialog(Context context, boolean cancelable, OnCancelListener cancelListener)
	{
		super(context, cancelable, cancelListener);
	}

	public MyProgressDialog(Context context, int theme, int screenheight, int screenwidth)
	{
		super(context, theme);
	}

	public static MyProgressDialog createMyDialog(Context context, int screenheight, int screenwidth)
	{
		myProgressDialog = new MyProgressDialog(context, R.style.my_dialog, screenheight, screenwidth);
		myProgressDialog.setContentView(R.layout.cricle_progress);
		WindowManager.LayoutParams params = myProgressDialog.getWindow().getAttributes();
		params.width = screenwidth;
		params.height = screenheight;
		myProgressDialog.getWindow().setAttributes(params);
		myProgressDialog.getWindow().getAttributes().gravity = Gravity.CENTER;
		myProgress = (RoundProgressBar) myProgressDialog.findViewById(R.id.roundProgressBar);
		return myProgressDialog;
	}

	public RoundProgressBar getMyProgress()
	{
		return myProgress;
	}

}
